package com.example.back.controller;

import com.example.back.dto.req.ChangePasswordReq;
import com.example.back.service.ChangePasswordService;
import com.example.common.support.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 修改密码
 */
@RestController
@Api(tags = "修改密码")
@RequestMapping("/api/ChangePassword")
public class ChangePasswordController {
    @Resource
    private ChangePasswordService changePasswordService;

    @ApiOperation(value = "修改密码信息", notes = "修改密码信息")
    @PostMapping(value = "/saveChange")
    public Result<Object> saveChange(@RequestBody ChangePasswordReq req) {
        return Result.success(changePasswordService.saveChange(req));
    }
}
